package model

import (
	"manager/model/entity"
)

// VoiceSettingCreateRequest 创建现场数据
type VoiceSettingCreateRequest struct {
	UserId int64 `json:"user_id"`

	SeriesType int64 `json:"series_type"`

	UpdatedAt int64 `json:"updated_at"`
}

// VoiceSettingUpdateRequest 更新现场数据
type VoiceSettingUpdateRequest struct {
	Id int64 `json:"id"`

	UserId *int64 `json:"user_id"`

	SeriesType *int64 `json:"series_type"`

	CreatedAt int64 `json:"created_at"`

	UpdatedAt *int64 `json:"updated_at"`
}

// VoiceSettingListRequest 列表现场数据
type VoiceSettingListRequest struct {
	Index int `json:"index"`
	Size  int `json:"size"`

	Id int64 `json:"id"`

	UserId *int64 `json:"user_id"`

	SeriesType *int64 `json:"series_type"`

	UpdatedAt *int64 `json:"updated_at"`
}

// VoiceSettingListResponse 列表回包数据
type VoiceSettingListResponse struct {
	Total int                 `json:"total"`
	List  []*VoiceSettingInfo `json:"list"`
}

// VoiceSettingInfoRequest 列表现场数据
type VoiceSettingInfoRequest struct {
	Id int64 `json:"id"`

	UserId *int64 `json:"user_id"`

	SeriesType *int64 `json:"series_type"`

	UpdatedAt *int64 `json:"updated_at"`
}

// VoiceSettingInfo 详细数据
type VoiceSettingInfo struct {
	Id int64 `json:"id"`

	UserId int64 `json:"user_id"`

	SeriesType int64 `json:"series_type"`

	CreatedAt int64 `json:"created_at"`

	UpdatedAt int64 `json:"updated_at"`
}

// VoiceSettingDeleteRequest 删除现场数据
type VoiceSettingDeleteRequest struct {
	Id int64 `json:"id"`
}

// VoiceSettingsEntityToDto entity数据转换
func VoiceSettingsEntityToDto(voiceSettings []*entity.VoiceSetting) []*VoiceSettingInfo {
	out := make([]*VoiceSettingInfo, 0, len(voiceSettings))
	for _, c := range voiceSettings {
		out = append(out, VoiceSettingEntityToDto(c))
	}
	return out
}

// VoiceSettingEntityToDto entity数据转换
func VoiceSettingEntityToDto(e *entity.VoiceSetting) *VoiceSettingInfo {
	return &VoiceSettingInfo{

		Id: e.Id,

		UserId: e.UserId,

		SeriesType: e.SeriesType,

		CreatedAt: e.CreatedAt,

		UpdatedAt: e.UpdatedAt,
	}
}
